package edu.pw.treegrid.client.report.model;

import com.smartgwt.client.widgets.grid.ListGridRecord;

import edu.pw.treegrid.shared.ReportColumnCategory;
import edu.pw.treegrid.shared.ReportColumnDescription;
import edu.pw.treegrid.shared.ReportColumnType;

public class ReportColumnDescriptionClient extends ListGridRecord implements ReportColumnDescription {
	
	public String getName() {
		return getAttribute(NAME);
	}

	public void setName(String name) {
		setAttribute(NAME, name);
	}

	public String getTitle() {
		return getAttribute(TITLE);
	}

	public void setTitle(String title) {
		setAttribute(TITLE, title);
	}

	public String getImageSrc() {
		return getAttribute(IMAGE_SRC);
	}

	public void setImageSrc(String imageSrc) {
		setAttribute(IMAGE_SRC, imageSrc);
	}

	public ReportColumnType getType() {
		return (ReportColumnType)getAttributeAsObject(TYPE);
	}

	public void setType(ReportColumnType type) {
		setAttribute(TYPE, type);
	}

	public void setFolder(boolean isFolder) {
		setAttribute(FOLDER_COLUMN, isFolder);	
	}

	public boolean isFolder() {
		return getAttributeAsBoolean(FOLDER_COLUMN); 
	}

	public ReportColumnCategory getCategory() {
		return (ReportColumnCategory)getAttributeAsObject(CATEGORY);
	}

	public void setCategory(ReportColumnCategory category) {
		setAttribute(CATEGORY, category);
	}

	public String getFormat() {
		return getAttribute(FORMAT);
	}

	public void setFormat(String format) {
		setAttribute(FORMAT, format);
	}

	@Override
	public String getDescription() {
		return getAttribute(DESCRIPTION);
	}

	@Override
	public void setDescription(String description) {
		setAttribute(DESCRIPTION, description);
	}

	@Override
	public String getWidth() {
		return getAttribute(WIDTH);
	}

	@Override
	public void setWidth(String width) {
		setAttribute(WIDTH, width);
	}

}
